<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head><title>用户列表页</title>
    <script  src="../js/jquery-2.1.4.js"></script>
     <link rel="stylesheet" href="../css/lanrenzhijia.css" media="all">
           <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
   <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script>
jQuery(document).ready(function($) {
	$('.theme-login').click(function(){
		$('.theme-popover-mask').fadeIn(100);
		$('.theme-popover').slideDown(200);
	});
	$('.theme-poptit .close').click(function(){
		$('.theme-popover-mask').fadeOut(100);
		$('.theme-popover').slideUp(200);
	});
    
});
$(document).ready(function(){
	$('.user3').click(function(){
		$('#usernumber').attr("value",$(this).attr('id'));
	});
});
</script>
</head>
<body >
<div style="padding-left: 15px;height:auto;width:99%;" >
<h1>企业会员管理</h1><hr>
<font size="5"><a href="">管理首页</a>&nbsp;&nbsp;<a href="add_comMen.jsp">新增</a>&nbsp;&nbsp;<a href="query_user.jsp">查询</a>&nbsp;&nbsp;<a href="">返回上一级</a></font>
    <div  >
<form action="comMen_list_delete.jsp" method="post" >
<table class="table table-bordered">
   <thead>
      <tr>
         <th> <input type="checkbox" id="all" ></th>
         <th>用户名</th>
         <th>Email</th>
         <th>注册日期</th>
         <th>登录次数</th>
         <th>修改</th>
         <th>删除</th>
      </tr>
   </thead>    
         <tbody> 
      <% ResultSet rs=null;
        Statement statement=null;
        try{
        Driver driver=new com.mysql.jdbc.Driver();
        DriverManager.registerDriver(driver);
         Connection connection=DriverManager.getConnection("jdbc:mysql://www.ccjjltx.cn:3307/numbersystem?useUnicode=true&characterEncoding=utf8","root","usbw");
         String sql="select * from  user where GroupNumber='企业会员'";  //创建执行语句
         statement=connection.createStatement();
         rs=statement.executeQuery(sql);
         while(rs.next())
        { %>
                <tr>
                <td ><input type="checkbox" id="comMen" name="comMens" value="<%=rs.getInt("usernumber")%>" ></td>
                 <td><%=rs.getString("username")%></td>
                <td><%=rs.getString("email")%></td>
                <td><%=rs.getString("registertime")%></td>
                <td><%=rs.getInt("logintime")%></td>
                <td> <a style="background-color:fff;border:0" class="btn btn-primary btn-large theme-login" id="edit" name="<%=rs.getInt("usernumber")%>" href="javascript:;%>"><input type="button" style="background-color:fff;border:0" class="user3" id="<%=rs.getInt("usernumber")%>" value="编辑"></a></td>
                <td><a href="comMen_delete_do.jsp?usernumber=<%=rs.getInt("usernumber")%>">删除</a></td>
            </tr>
           
        <% } 
        }catch(Exception e){
        e.printStackTrace();
        }
        %>
        <tr><td><input type="submit" style="background-color:fff;border:0"  value="删除所选中项" ></td></tr>
           </tbody>
    </table>
</form>
        </div>
    </div>
<script >
    $(document).ready(function(){

        $('#all').click(function(){
            $('input:checkbox[name]').prop('checked',this.checked);
        });

        $('input:checkbox[name]').click(function(){
            isall=$('input:checkbox[name]').length==$('input:checkbox[name]:checked').length;
            $('#all').prop('checked',isall);
        });
    });
</script>
<div class="theme-popover" style="height:300px">
     <div class="theme-poptit">
          <a href="javascript:;" title="关闭" class="close">×</a>
          <h3></h3>
     </div>
     <div class="theme-popbod dform">
           <form class="theme-signin" name="loginform" action="comMen_update_do.jsp" method="post">
                <ol>
                     <li><strong>密码：</strong><input class="ipt" type="text" name="pwd" value="" size="20" /></li>
                     <li><strong>email：</strong><input class="ipt" type="email" name="email" value="" size="20" /></li>
                     <li><input class="ipt" type="hidden" id="usernumber" name="usernumber"   /></li>
                     <li><input class="btn btn-primary" type="submit" style="width:200px;height:40px" name="submit" value=" 修改 " /></li>
                </ol>
           </form>
     </div>
</div>
</body>
</html>
